package com.zdtech.action;

import java.util.List;

import javax.annotation.Resource;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.zdtech.entity.TBill;
import com.zdtech.entity.TSingle;
import com.zdtech.service.BaseSerive;
import com.zdtech.util.DateUtil;
import com.zdtech.util.StringUtil;

public class PayAction extends ActionSupport{
	
	private List<TSingle> singlelist;
	private String total;
	private String remark;
	private String method;
	@Resource
	private BaseSerive baseSerive;
	
	public String execute() throws Exception {
		if(singlelist.size()>0){
			if(StringUtil.isEmpty(total)){
				double totalprice = 0;
				for (TSingle tSingle : singlelist) {
					double price = baseSerive.getMenu(tSingle.getMenuId()).getPrice();
					totalprice += price*tSingle.getNum();
				}
				if(Double.parseDouble(total)==totalprice){
					/*TBill bill = new TBill();
					bill.set
					baseSerive.insertBill(b)*/
				}
			}
		}
		return Action.SUCCESS;
	}
	
}
